<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>背景切换</title>
<style>
    body {
        background: url(bg_images/a1.jpg) no-repeat center center/cover;
        font-family: Arial, sans-serif;
    }
    .gallery {
        display: flex;
        justify-content: space-around;
        align-items: center;
        margin: 120px auto;
        width: 720px;
        padding: 15px;
        background: rgba(255, 255, 255, 0.6);
        border-radius: 12px;
    }
    img {
        width: 160px;
        height: 180px;
        border-radius: 50%; /* 圆形图片 */
        cursor: pointer;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    img:hover {
        transform: scale(1.15);
        box-shadow: 0 6px 15px rgba(0,0,0,0.5);
    }
</style>
</head>
<body>
    <div class="gallery">
        <img src="bg_images/a1.jpg" alt="">
        <img src="bg_images/a2.jpg" alt="">
        <img src="bg_images/a3.jpeg" alt="">
        <img src="bg_images/a4.jpg" alt="">
    </div>
<script>
    document.querySelectorAll('.gallery img').forEach(img => {
        img.onclick = function() {
            document.body.style.backgroundImage = `url(${this.src})`;
        };
    });
</script>
</body>
</html>
